package beautiful.butterfly.distributed_task_processing_engine.tools;


import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.Map;

public class TaskItemParameterStrings
{
    public static Map<String, String> parseTaskItemParameterString(String string)
    {
        Gson gson = new Gson();
        Type type = new TypeToken<Map<String, String>>()
        {
        }.getType();
        Map<String, String> map = gson.fromJson("{" + string + "}", type);
        return map;
    }

    public static void main(String[] args)
    {
        Map<String, String> map = parseTaskItemParameterString("{mod=0,all=11}");
        System.out.println(map.get("mod"));
    }
}
